Skip to content

Conversation

@Strech
Copy link
Member

@Strech Strech commented Nov 5, 2025

What does this PR do?

Adds new component under lib/datadog/open_feature/ folder that is providing customer an ability to configure Datadog feature flags provider. This provider is going to rely on Remote Configuration to deliver feature flags configurations (aka UFC Universal Flag Configuration).

Said provider is going into customer code as a part of configuration for OpenFeature

require 'open_feature/sdk'
require 'datadog/open_feature/provider'

Datadog.configure do |config|
  config.open_feature.enabled = true
end

OpenFeature::SDK.configure do |config|
  config.set_provider(Datadog::OpenFeature::Provider.new)
end

client = OpenFeature::SDK.build_client
client.fetch_string_value(flag_key: 'banner', default_value: 'default')
# => 'something-for-that-context'

Motivation:

This is a part of upcoming work across all libs.

Important

This code doesn't contain actual evaluation logic, but rather establish everything for it to be placed in the next PR.

Change log entry

No. Will be announced in another PR

Additional Notes:

This PR was already reviewed as a part of #5022, but accidentally was marked as ready for review. This code is fresh and already applied some suggestions from the previous review, but not everything is possible due to the existing established way or the time boundaries.

Structure:

lib/datadog/open_feature
├── binding <------- A pre-made place for upcoming binding (written in Ruby)
├── exposures <----- Every time we fetch the flag value we are sending exposure event
├── provider.rb <--- A public API class we expose (see example above)
└── transport <----- Implementation that goes along with existing components

I would like to ask some pair of eyes on thread-safety and potential issues of new component. I've run the code over certain checks already, but never enough.

How to test the change?

CI and we will have new set of ST in #5022 enabled to prove that everything works.

@github-actions
Copy link

github-actions bot commented Nov 5, 2025

Thank you for updating Change log entry section 👏

Visited at: 2025-11-11 09:56:41 UTC

@github-actions github-actions bot added core Involves Datadog core libraries appsec Application Security monitoring product labels Nov 5, 2025
@pr-commenter
Copy link

pr-commenter bot commented Nov 5, 2025

Benchmarks

Benchmark execution time: 2025-11-13 11:20:27

Comparing candidate commit e572afc in PR branch ffl-1319-add-agent-communication-for-openfeature with baseline commit e4ed440 in branch master.

Found 1 performance improvements and 2 performance regressions! Performance is the same for 41 metrics, 2 unstable metrics.

scenario:error - error tracking, with_error=true - third_party only

  • 🟥 throughput [-660.099op/s; -577.527op/s] or [-5.881%; -5.146%]

scenario:profiling - Allocations ()

  • 🟥 throughput [-260821.824op/s; -230695.621op/s] or [-7.897%; -6.985%]

scenario:profiling - stack collector (varying depth)

  • 🟩 throughput [+56.667op/s; +57.451op/s] or [+6.302%; +6.389%]

@Strech Strech force-pushed the ffl-1319-add-agent-communication-for-openfeature branch from dbc899c to 0a25c37 Compare November 6, 2025 11:44
@Strech Strech force-pushed the ffl-1319-add-agent-communication-for-openfeature branch 3 times, most recently from b1a978f to 9e7efb0 Compare November 10, 2025 10:02
@github-actions github-actions bot added integrations Involves tracing integrations profiling Involves Datadog profiling tracing labels Nov 10, 2025
@Strech Strech changed the base branch from add-openfeature-component to master November 10, 2025 12:42
@github-actions
Copy link

github-actions bot commented Nov 10, 2025

Typing analysis

Note: Ignored files are excluded from the next sections.

Untyped methods

This PR introduces 2 untyped methods and 5 partially typed methods. It increases the percentage of typed methods from 53.12% to 54.7% (+1.58%).

Untyped methods (+2-0)Introduced:
sig/datadog/open_feature/provider.rbs:8
└── def initialize: () -> void
sig/datadog/open_feature/transport/http/api.rbs:8
└── def self?.defaults: () -> untyped
Partially typed methods (+5-0)Introduced:
sig/datadog/open_feature/configuration.rbs:12
└── def self.add_settings!: (untyped base) -> void
sig/datadog/open_feature/exposures/event.rbs:33
└── def self.extract_attributes: (::OpenFeature::SDK::EvaluationContext) -> ::Hash[::String, untyped]
sig/datadog/open_feature/exposures/worker.rbs:48
└── def perform: (*untyped) -> void
sig/datadog/open_feature/transport/exposures.rbs:14
└── def initialize: (OpenFeature::Transport::Exposures::EncodedParcel, ?::Hash[::Symbol, untyped]?) -> void
sig/datadog/open_feature/transport/exposures.rbs:28
└── def send_exposures: (::Hash[::Symbol, untyped], ?headers: ::Hash[::Symbol, untyped]?) -> Core::Transport::Response

Untyped other declarations

This PR introduces 1 untyped other declaration and 3 partially typed other declarations. It increases the percentage of typed other declarations from 66.95% to 68.02% (+1.07%).

Untyped other declarations (+1-0)Introduced:
sig/datadog/open_feature/resolution_details.rbs:4
└── attr_accessor value: untyped
Partially typed other declarations (+3-0)Introduced:
sig/datadog/open_feature/resolution_details.rbs:14
└── attr_accessor flag_metadata: ::Hash[::String, untyped]?
sig/datadog/open_feature/resolution_details.rbs:18
└── attr_accessor extra_logging: ::Hash[::String, untyped]?
sig/datadog/open_feature/transport/exposures.rbs:12
└── attr_reader headers: ::Hash[::Symbol, untyped]

If you believe a method or an attribute is rightfully untyped or partially typed, you can add # untyped:accept to the end of the line to remove it from the stats.

@datadog-datadog-prod-us1
Copy link
Contributor

datadog-datadog-prod-us1 bot commented Nov 10, 2025

✅ Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

🎯 Code Coverage
Patch Coverage: 94.44%
Total Coverage: 98.51% (-0.03%)

View detailed report

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: e572afc | Docs | Datadog PR Page | Was this helpful? Give us feedback!

@Strech Strech force-pushed the ffl-1319-add-agent-communication-for-openfeature branch from d7424f9 to 2221c34 Compare November 10, 2025 15:04
@Strech Strech marked this pull request as ready for review November 11, 2025 10:09
@Strech Strech requested a review from a team as a code owner November 11, 2025 10:09
@Strech Strech added the openfeature A new component that provider an ability to configure feature flags label Nov 11, 2025
@ivoanjo ivoanjo removed the profiling Involves Datadog profiling label Nov 11, 2025
@y9v y9v removed the appsec Application Security monitoring product label Nov 11, 2025
Copy link
Member

@ivoanjo ivoanjo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a few notes!

Strech and others added 24 commits November 13, 2025 11:12
@Strech Strech force-pushed the ffl-1319-add-agent-communication-for-openfeature branch from 511d86e to 14b676f Compare November 13, 2025 10:13
* Improve performance of the hot-paths
* Add error handling in remote configuration
* Complete shutdown process
@Strech Strech force-pushed the ffl-1319-add-agent-communication-for-openfeature branch from 14b676f to e572afc Compare November 13, 2025 10:51
@Strech Strech merged commit 38d2bd9 into master Nov 13, 2025
566 checks passed
@Strech Strech deleted the ffl-1319-add-agent-communication-for-openfeature branch November 13, 2025 16:27
@github-actions github-actions bot added this to the 2.23.0 milestone Nov 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Involves Datadog core libraries integrations Involves tracing integrations openfeature A new component that provider an ability to configure feature flags tracing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants